package org.sdnstproject.interlayer.openflowfuzzing;

import org.projectfloodlight.openflow.protocol.*;

/**
 * OpenFlow 报文修改插件.
 * <p>根据每个动作为MODFIY的策略对象生成对应的OpenFlow报文.
 * */
public class PacketModifier {

	public Strategy strategy;
	
	public PacketModifier(Strategy strategy) {
		this.strategy = strategy;
	}
	public OFMessage doPacketModify() {
		OFFactory factory = OFFactories.getFactory(strategy.ofVersion);
		OFPortStatus.Builder builder = factory.buildPortStatus();
//		OFPortReason reason = factory.
//		builder.setXid(Long.valueOf(strategy.actionValue)).setReason(reason);
		OFPortStatus ofPortState = builder.build();
		System.out.println(ofPortState.toString());
		return ofPortState;
		
	}
	
	
}
